
use serde::{Deserialize, Serialize};

#[derive(Debug,Serialize,Deserialize,sqlx::FromRow)]
pub(crate) struct User{
    id:u32,
    name:String,
    age:u32,
    address:String,
}

#[derive(Debug,Serialize,Deserialize,sqlx::FromRow)]
pub(crate) struct UserVoForAdd{
    name:String,
    age:u32,
    address:String,
}

impl User{
    pub(crate) fn new(id:u32,name:String,age:u32,address:String)->Self{
        User{
            id,
            name,
            age,
            address,
        }
    }

    pub(crate) fn get_name(&self)->String{
        self.name.clone()
    }

    pub(crate) fn get_age(&self)->u32{
        self.age
    }

    pub(crate) fn get_address(&self)->String{
        self.address.clone()
    }


}

impl UserVoForAdd {
    
    pub(crate) fn new(id:u32,name:String,age:u32,address:String)->Self{
        UserVoForAdd{
            name,
            age,
            address,
        }
    }

    pub(crate) fn get_name(&self)->String{
        self.name.clone()
    }

    pub(crate) fn get_age(&self)->u32{
        self.age
    }

    pub(crate) fn get_address(&self)->String{
        self.address.clone()
    }
}
